<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sd" uri="/struts-dojo-tags" %>

<script type="text/javascript" src="<s:url value="/js/commonAddress.js"/>"></script>
<script type="text/javascript" src="<s:url value="/js/ethicsCommitteeList.js"/>"></script>

<sd:head parseContent="true"/>
    <div id="filter">
        <s:form action="list" cssClass="tableFilter">
            <tr>
                <th colspan="2" class="tableTitle">
                    <h5>Search</h5>
                </th>
            </tr>

            <s:textfield label="Name" name="name" value="%{name}"/>

            <s:textfield label="Address" name="address.address" value="%{address.address}" />
            <s:hidden label="City" name="address.city" id="addressCity" value="%{address.city}" />
            <s:hidden label="Province" name="address.province" id="addressProvince" value="%{address.province}" />
            <s:hidden label="Country" name="address.country" id="addressCountry" value="%{address.country}" />
            <s:include value="../address/addressview.jsp"/>
            <tr>
                <td colspan="2" class="centeredButtons"><s:submit value="Search" name="filter" theme="simple" onclick="beforeSave()"/>
                    <s:submit action="create" value="New" theme="simple" onclick="resetForms();"/></td>
            </tr>

        </s:form>
    </div>
<s:if test="!list.isEmpty()">
    <div id="table_content">
        <table class="paginated-table">
        <thead>
                <tr>
                    <th>Name</th>
                    <th>Category</th>
                    <th>Country</th>
                    <th>Region</th>
                    <th>City</th>
                    <th>Address</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
            <s:iterator value="list" var="translator">
                <tr>
                    <th><s:property value="name"/></th>
                    <th><s:property value="category.name"/></th>
                    <th><s:property value="address.country"/></th>
                    <th><s:property value="address.province"/></th>
                    <th><s:property value="address.city"/></th>
                    <th><s:property value="address.address"/></th>
                    <th>
                        <s:form action="create" method="POST">
                            <s:hidden value="%{id}" name="editableCommitteeId"/>
                            <a onclick="$(this).closest('form').submit()"><img src="<s:url value="/images/edit.png"/>" title="Edit" alt="Edit"></a></TH>
                        </s:form>
                    </th>
                </tr>
            </s:iterator>

            <tbody>
        </table>
        <div style="width: 100%;text-align: center" >
            <span class="prev" style="" >Previous</span><span class="next">Next</span>
        </div>

        <script type="text/javascript">
            paginar(10);
        </script>
    </div>
</s:if>
<script type="text/javascript">
    var list = true;
</script>

<script type="text/javascript">
    $('#ethics').css({"color":"#EE5102","fontWeight":"bold"});
</script>